<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- 导入 layui 的样式 -->
  <link rel="stylesheet" href="../assets/lib/layui/css/layui.css">
  <link rel="stylesheet" href="../assets/css/books-list.css">
</head>

<body>
  <div class="layui-card">
    <div class="layui-card-header">文章列表</div>
    <div class="layui-card-body">
      <!-- 下拉框区域 -->
      <form class="layui-form layui-form-list" lay-filter="formArticleList">
        <div class="layui-form-item">
          <!-- <label class="layui-form-label">选择框</label> -->
          <div class="layui-input-block">
            <select name="cate_id" lay-verify="required" class="cate-select">

            </select>
          </div>
        </div>
        <div class="layui-form-item">
          <!-- <label class="layui-form-label">选择框</label> -->
          <div class="layui-input-block">
            <select name="state" lay-verify="required">
              <option value="已发布">已发布</option>
              <option value="草稿">草稿</option>
            </select>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">筛选</button>
          </div>
        </div>
      </form>
      <div class="layui-card-body">
        <table class="layui-table">
          <colgroup>
            <col width="50%">
            <col width="15%">
            <col>
          </colgroup>
          <thead>
            <tr>
              <th>文章标题</th>
              <th>分类</th>
              <th>发表时间</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>辣鸡</td>
              <td>范文芳</td>
              <td>2020.11.11</td>
              <td>已发布</td>
              <td>
                <button type="button" class="layui-btn layui-btn-xs ">编辑</button>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-danger">删除</button>
              </td>
            </tr>
            <!-- 这里做动态添加 -->

          </tbody>
        </table>
        <!-- 添加分页 -->
        <div id="sub-page"></div>
      </div>
    </div>
  </div>
  <!-- 创建编辑的模板引擎 -->
  <!-- 定义一个table列表数据的模板 -->
  <script type="text/html" id="article-table-tpl">
    {{ each data }}
      <tr>
        <td>{{$value.title}}</td>
        <td>{{$value.cate_name}}</td>
        <td>{{$value.pub_date | getTime}}</td>
        <td>{{$value.state}}</td>
        <td>
          <button type="button" class="layui-btn layui-btn-sm" id="article-edit" data-id="{{$value.Id}}">编辑</button>
          <button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="bbbb" data-id="{{$value.Id}}">删除</button>
        </td>
      </tr>
    {{/each}}
  </script>

  <script src="../assets/lib/jquery.js"></script>
  <script src="../assets/lib/template-web.js"></script>
  <script src="../assets/js/ajax-prefilter.js"></script>
  <script src="../assets/lib/layui/layui.all.js"></script>
  <!-- <script src="../assets/js/book-list.js"></script> -->
  <script src="../assets/js/book-list-new.js"></script>
</body>

</html>